(function(global){
	global.TRCKR = global.TRCKR || {};

    TRCKR.historyView = function(data){
        var render = function(){
//      TODO actions to render data
        };

    	return {
            render: render
        }
    }
})(this);

$(document).ready(function(){
	var TRCKR = chrome.extension.getBackgroundPage().TRCKR;
    TRCKR.historyController().analyze(function(data){
    	var visits = TRCKR.convertJsonToPieArray(data);
        line1 = [['frogs',3], ['buzzards',7], ['deer',2.5], ['turkeys',6], ['moles',5], ['ground hogs',4]];
        plot2 = $.jqplot('historychart', [visits], {
        title: 'Pie Chart with Legend and sliceMargin',
        seriesDefaults:{renderer:$.jqplot.PieRenderer},
        legend:{show:true}
       });
    });
});